<template>
        
        <el-tag
        v-for="(item, index) in bodyData"
        type="info"
        style="margin: 5px;"
        >
            {{ item.name }}
        </el-tag>


        <el-button @click="goodsWarehouseSelectIn.open()">
            选择
        </el-button>
    <GoodsWarehouseSelectIn ref="goodsWarehouseSelectIn"
    @select="select"
    />
</template>

<script lang="ts" setup>
import { ref,defineExpose,defineEmits } from 'vue';
import $kt from '@/vueKantboot';
import { ElMessage, ElMessageBox } from 'element-plus';
import GoodsWarehouseSelectIn from '@/components/goodsWarehouseSelect/goodsWarehouseSelectIn.vue';

let goodsWarehouseSelectIn = ref();

let bodyData = ref([]);

let emits = defineEmits(['select']);

let select = (res:any)=>{
    bodyData.value=res;
    // 只取出id
    let ids = [];
    for(let i=0;i<bodyData.value.length;i++){
        ids.push(bodyData.value[i].id);
    }
    emits("select",ids);
}

</script>

<style lang="scss" scoped>
.box {
    padding: 20px 20px 0 20px;
}

.box-box {
    background-color: #fff;
    color: #fff;
    text-align: center;
    padding: 30px;
    border-radius: 5px;
}


.box-box:hover {
    // 变小
    transform: scale(0.95);
}

.box-box:active {
    // 变小
    transform: scale(0.9);
}
</style>